package com.ganee.agora.viewmodel

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.ganee.agora.model.InsertActivityEntity
import com.ganee.agora.repository.*
import com.ganee.baselib.httprequest.callback.RequestCallback

import com.ganee.baselib.mvvmlibrary.base.BaseRepository
import com.ganee.baselib.mvvmlibrary.base.BaseViewModel
import okhttp3.RequestBody

class SearchFilterViewModel(application: Application) : BaseViewModel<SearchRepository>(application) {

    var searchList = MutableLiveData<List<InsertActivityEntity>>()

    override fun getRepository(): SearchRepository {
        return SearchRepository(this)
    }


    //请求搜索列表
    fun getSearchList(body: RequestBody) {
        mRepository.getSearchList(body, RequestCallback<List<InsertActivityEntity>> { entity ->
            searchList.value = entity
        })
    }
}
